package com.aiju.support.aop;

import java.util.List;

/**
 * @author: 佐为
 * @date: 2017-03-21 16:20
 * @version: V1.0
 * @Description: 代理工厂
 */
public abstract class AProxyFactory<T> implements IProxyFactory<T> {

    public AProxyFactory() {
    }

    public T makeProxy() {
        Object proxied = this.createProxied();
        IInterceptorHandler handler = this.createInterceptorHandler();
        List interceptors = this.createInterceptors();
        return (T) (handler != null && interceptors != null ? handler.bind(proxied, interceptors) : proxied);
    }
}
